﻿using System.ComponentModel.DataAnnotations;

namespace Contoso_University.Models
{
    public abstract class Person
    {
        public int ID { get; set; }

        [Required]
        [StringLength(50)]
        [Display(Name = "姓")]
        public string LastName { get; set; }

        [Required]
        [StringLength(50, ErrorMessage = "名不能超过50个字符。")]
        [Display(Name = "名")]
        public string FirstName { get; set; }

        [Display(Name = "全名")]
        public string FullName => $"{LastName}, {FirstName}";
    }
}
